<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
    //返回一个结果
    function fun1(a,b){
      return a+b;
    }
    var rs = fun1(3,9);
    document.write(rs);
    document.write('<br/>');
    //返回一个数组
    function fun2(a,b){
        arr = [];
        arr.push(a*3);
        arr.push(b*3);
        return arr;
    }
    var arr = fun2(3,9);
    document.write(arr);
    document.write('<br/>');
    //返回一个对象
    function fun3(id,name){
        obj = {};
        obj['id']=id;
        obj['name']=name;
        return obj;
    }
    var obj = fun3(5,'赵云');
    document.write(obj);
    document.write('<br/>');
    document.write(obj.name);

  </script>
 </body>
</html>
